<%--
  Created by IntelliJ IDEA.
  User: oldliu
  Date: 2022-03-24
  Time: 14:32
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>Title</title>
    <script src="../js/jquery-3.4.1.min.js"></script>
    <script>
        $(function(){
           $("#go").click(function () {
               let p=$(this).prev().val();
               window.location.href="search?page="+p;
           });
        });
    </script>
</head>
<body>
<p style="color:red;">

    ${msg}
</p>
<%--当前${p.page},总共${p.totalPages}页,总条数${p.count}--%>
<a href="../addContract.jsp">新增合同</a>
<table border="1" cellpadding="0" cellspacing="0">
    <c:forEach items="${p.data}" var="c">
        <tr>
            <td>${c.id}</td>
            <td>${c.contractno}</td>
            <td>${c.ctime}</td>
            <td>${c.billno}</td>
            <td>${c.marker}</td>
            <td>${c.seller}</td>
            <td><a href="show?id=${c.id}">查看详细</a>
                <a href="toUpdate-${c.id}">修改</a>
                <a href="del-${c.id}">删除</a>
            </td>
        </tr>
    </c:forEach>
</table>
<p>
    <a href="search?page=1">首页</a>
    <a href="search?page=${p.page-1}">上一页</a>
    <a href="search?page=${p.page+1}">下一页</a>
    <input type="number" min="1" name="page" value="${p.page}" id="page" size="3">
    <input type="button" value="Go" id="go"/>
    <a href="search?page=${p.totalPages}">最后一页</a>
</p>
</body>
</html>
